package com.yunji.base.dao.impl;

import com.yunji.base.dao.IAgentDao;
import com.yunji.base.dto.AgentFieldDTO;
import com.yunji.base.mapper.IAgentMapper;
import com.yunji.common.base.BaseDaoImpl;
import com.yunji.common.model.domain.AgentDO;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author : peter-zhu
 * @date : 2024/12/9 16:28
 * @description : TODO
 **/
@Repository
public class AgentDaoImpl extends BaseDaoImpl<IAgentMapper, AgentDO> implements IAgentDao {
    @Override
    public List<AgentDO> listByBelongIds(List<Long> belongIds) {
        return lambdaQuery().in(AgentDO::getBelongId, belongIds).list();
    }

    @Override
    public List<String> searchTableFiled(AgentFieldDTO param) {
        return baseMapper.searchTableFiled(param);
    }


    @Override
    public AgentDO getByBelongId(Long belongId) {
        return lambdaQuery().eq(AgentDO::getBelongId, belongId).one();
    }
}
